package game.units;

import game.enums.Alignment;
import game.enums.Size;
import game.referenceValues.Magic;
import game.referenceValues.Race;

import java.util.ArrayList;

public class Unit {

	//Character Parameters
	private String name;
	private int height;
	private int weight;
	private String gender;
	private String deity;
	private Size size;	
	private Alignment alignment;
	
	private int level;
	private int expirience;
	
	//Character Attack and Defense Bases
	private int armorClass;
	private int fortitude;
	private int reflex;
	private int will;
	private int attackBase;
	
	private ArrayList<Attribute> attributes;
	private ArrayList<Magic> magics;
	private Race race;
	
	//Constructors
	
	public Unit()
	{
		
	}
	
	public Unit(String name, int height, int weight, String gender,
			String deity, Size size, Alignment alignment, int level,
			int expirience, int armorClass, int fortitude, int reflex,
			int will, int attackBase, ArrayList<Attribute> attributes,
			ArrayList<Magic> magics, Race race) {
		this.name = name;
		this.height = height;
		this.weight = weight;
		this.gender = gender;
		this.deity = deity;
		this.size = size;
		this.alignment = alignment;
		this.level = level;
		this.expirience = expirience;
		this.armorClass = armorClass;
		this.fortitude = fortitude;
		this.reflex = reflex;
		this.will = will;
		this.attackBase = attackBase;
		this.attributes = attributes;
		this.magics = magics;
		this.race = race;
	}


	public Alignment getAlignment() {
		return alignment;
	}

	public void setAlignment(Alignment alignment) {
		this.alignment = alignment;
	}

	public int getArmorClass() {
		return armorClass;
	}

	public void setArmorClass(int armorClass) {
		this.armorClass = armorClass;
	}

	public int getAttackBase() {
		return attackBase;
	}

	public void setAttackBase(int attackBase) {
		this.attackBase = attackBase;
	}

	public ArrayList<Attribute> getAttributes() {
		return attributes;
	}

	public void setAttributeValue(String attributeName, int value) {
		for (Attribute attribute : attributes) 
		{
			if(attribute.getName().equals(attributeName))
				attribute.setValue(value);
		}
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getDeity() {
		return deity;
	}

	public void setDeity(String deity) {
		this.deity = deity;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}
	
	public int getExpirience() {
		return expirience;
	}

	public void setExpirience(int expirience) {
		this.expirience = expirience;
	}

	public int getFortitude() {
		return fortitude;
	}

	public void setFortitude(int fortitude) {
		this.fortitude = fortitude;
	}

	public ArrayList<Magic> getMagics() {
		return magics;
	}

	public void learnMagic(Magic magic) {
		this.magics.add(magic);
	}
	
	public void forgetMagic(Magic magic) {
		for (Magic m : magics) 
		{
			if(m.getName().equals(magic))
				magics.remove(m);
		}
	}
	

	public String getName() {
		return name;
	}
	

	public void setName(String name) {
		this.name = name;
	}
	

	public int getWeight() {
		return weight;
	}
	

	public void setWeight(int weight) {
		this.weight = weight;
	}
	

	public Size getSize() {
		return size;
	}
	

	public void setSize(Size size) {
		this.size = size;
	}
	

	public int getReflex() {
		return reflex;
	}
	

	public void setReflex(int reflex) {
		this.reflex = reflex;
	}
	

	public int getWill() {
		return will;
	}
	

	public void setWill(int will) {
		this.will = will;
	}
	

	public Race getRace() {
		return race;
	}
	

	public void setRace(Race race) {
		this.race = race;
	}
	
	
}
